﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class CategoryInfoConfig : EntityTypeConfiguration<CategoryInfo>
    {
        public CategoryInfoConfig()
        {
            ToTable("Himall_Categories");
            Property(item => item.Name).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Icon).HasColumnType("varchar").HasMaxLength(1000);
            Property(item => item.Path).HasColumnType("varchar").HasMaxLength(1000);
            Property(item => item.RewriteName).HasColumnType("varchar").HasMaxLength(50);
            Property(item => item.Meta_Description).HasColumnType("varchar").HasMaxLength(1000);
            Property(item => item.Meta_Keywords).HasColumnType("varchar").HasMaxLength(1000);
            Property(item => item.Meta_Title).HasColumnType("varchar").HasMaxLength(1000);
            HasRequired(x => x.ProductTypeInfo).WithMany(x => x.CategoryInfo).HasForeignKey(x => x.TypeId);
        }
    }
}
